package com.warm.androidstudy;

import android.app.Application;
import android.content.Context;

public class MyApplication extends Application {
    private static MyApplication instance;
    private static Context mContext;

    /**
     * 单一实例
     */
    public static MyApplication getInstance() {
//        if (instance == null) {
//            instance = new MyApplication();
//        }
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        mContext = getApplicationContext();
    }
    public static Context getContext() {
        return mContext;
    }
}
